#include <string.h>
#include <stdio.h>

#include "hq_aes.h"
#include "base64.h"

int main(int argc, char **argv)
{
    /*
     *
     * 
    unsigned char *key = (unsigned char *)"012345678901234567890123";
    unsigned char *iv = NULL;
    unsigned char *plaintext =
        (unsigned char *)"hello";
    unsigned char ciphertext[128];
    unsigned char decryptedtext[128];
    int decryptedtext_len, ciphertext_len;

    ciphertext_len = HqAesEncStr(plaintext, 5, key, iv, ciphertext);

    printf("Ciphertext is:\n");
    BIO_dump_fp(stdout, (const char *)ciphertext, ciphertext_len);

    decryptedtext_len = HqAesDecStr(ciphertext, ciphertext_len, key, iv,
                                    decryptedtext);
    decryptedtext[decryptedtext_len] = '\0';

    printf("Decrypted text is:\n");
    printf("%s\n", decryptedtext);

    // encrypt and decrypt a file
    HqAesEncFile("a.txt", key, NULL, "a.enc");
    HqAesDecFile("a.enc", key, NULL, "a.dec");
    *
    *
    */

    /*
    printf("Base64 Decode Len:\t%d\n", b64_decodef("be.txt", "b.orig"));
    printf("Base64 Encode Len:\t%d\n", b64_encodef("bd.txt", "b.cnv"));
    */

    printf("Base64 Encode:", b64_encodef(argv[1], argv[2]));
    printf("Base64 Encode:", b64_decodef(argv[3], argv[4]));

    printf("Test Done!\n");
}
